#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<string>
using namespace std;
class Solution {
public:
    string minWindow(string s, string t) {
        if (t.size() > s.size())
            return "";

        int left = 0, right = 0;
        string str;
        vector<int> hashi(58, 0);
        for (auto e : t) {

            hashi[e - 'A']++;
        }

        int len = INT_MAX;
        while (right <= s.size()) {

            bool flag = true;
            for (auto e : t) {
                if (hashi[e - 'A'] > 0) {
                    flag = false;
                    break;
                }
            }
            if (flag == false) {
                hashi[s[right] - 'A']--;
                right++;
            }
            else {
                if (right - left < len) {
                    len = right - left;
                    str = { s.begin() + left, s.begin() + right };
                }
                hashi[s[left++] - 'A']++;
            }
        }
        return str;
    }
};
int main()
{
    Solution s;
   string str= s.minWindow("ADOBECODEBANC", "ABC");
   cout << str;
	return 0;
}